package JavaLearning01;

import java.io.ObjectInputStream.GetField;
import java.util.Arrays;


public class JavaLearning01 {
	// vars
	private int from = 2;
	private int to = 4;
	
	private String[] f = {"asdf", "aaa", "bbb", "ccc", "dude", "str", "cokolif"};
	private String[] t = {"blbost"};
	
	// methods
	/*
	 * @param arrayFrom values taken from this array
	 * @param arrayTo values put in this array
	 * @param start start index
	 * @param end end index
	 */
	public void arrayManipulation(String[] arrayFrom, String[] arrayTo, int start, int end){
		arrayTo = java.util.Arrays.copyOfRange(arrayFrom, start, end);
		
		System.out.println(Arrays.toString(arrayFrom));
		System.out.println(Arrays.toString(arrayTo));
		
		sett(arrayTo);
	}
	
	// getters
	public int getFrom(){ return from; };
	public int getTo(){ return to; };
	public String[] getf(){ return f; };
	public String[] gett(){ return t; };
	
	// setters
	public void sett(String[] source){ t = source; };
	
	// constructor
	public static void main (String[] args){
		JavaLearning01 jl = new JavaLearning01();
		
		jl.arrayManipulation(jl.getf(), jl.gett(), jl.getFrom(), jl.getTo());
		
		System.out.println(Arrays.toString(jl.gett()));
	};
}
